<%-- 
    Document   : index
    Created on : Apr 9, 2014, 3:42:34 PM
    Author     : mekendall
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="edu.manchester.biology.eqhei.interfaces.*" %>
<%@page import="edu.manchester.biology.eqhei.implementations.*" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta charset="utf-8" />
        <link href="CSS/AllSpark.css" rel="stylesheet" type="text/css" media="screen" />
        <script type="text/javascript" src="JavaScript/AllSpark.js"></script>
        <title>AllSpark</title>
        
         <%
            eQHEI_Evaluation eval = (eQHEI_Evaluation) session.getAttribute("Eval");
         %>
    </head>

    <body onload="onLoad()">
        
        <div class="center" id="header"> AllSpark eQHEI Form </div>
        
        
<form id="form" action="eval" method="post">
<fieldset>
    <div id="0" class="contact gone">
        <h1> eQHEI Form </h1>
        <h2>Header</h2>
        <label  for="username"> Username:</label>
        <input type="text" id="username" name="username"/>
        <br>
        <label  for="date"> Date:</label>
        <input type="date" id="date" name="date"/>
        <br>
        <label  for="UTM"> UTM:</label>
        <input type="number" id="UTM" name="UTM"/>
        <br>
        <label  for="stream"> Stream Reach:</label>
        <input type="text" id="stream" name="stream"/>
        <br>
        <input type="button" value="Next" onclick="onSubmit(0,true)"/>
        <input type="button" value="Previous" onclick="onSubmit(0,false)"/>
    </div>
        <%
            for(int h=0; h<eval.length(); h++)
            {
                eQHEI_Section s = eval.get(h);
                
            
        %>
            
                     <div id="<%=h+1%>" class="contact gone" >
                        <h1 id="section"> <%=s.getName()%> </h1>
                        <%
                            for(int i = 0; i<s.length(); i++)
                            {
                                eQHEI_AttributeSet as = s.get(i);
                        %>
                                <h2> <%=as.getName()%> </h2>
                                <%
                                    for(int j = 0; j<as.length(); j++)
                                    {   //str = Attribute Set Name + "_" + Attribute Name
                                        String str = as.get(j).getName();
    //                                    while(str.contains(" ")){
    //                                        str=str.replace(" ","_");
    //                                    }
                                        str += "_"+as.getName();
                                %>
                                    <label  for="<%=str%>"><%=as.get(j).getName()%>:</label>
                                    <input type="number" id="<%=str%>" name="<%=str%>" min="0" value="0"/>
                                    <script>setMax("<%=str%>");</script>
                                    <br>
                        <%
                                    }
                            }
                        %>
                        <input type="button" value="Next" onclick="onSubmit(<%=h+1%>,true)"/>
                        <input type="button" value="Previous" onclick="onSubmit(<%=h+1%>,false)"/>
                     </div>
        <%
            }
        %>

                </fieldset>
            </form>
        <div class="center" id="footer"> Copyright ©2014 A.U.T.O.B.O.T.S. All rights reserved. </div>
        
    </body>
</html>
